import 'package:distribution_mall_flutter/base/base_service.dart';
import 'package:distribution_mall_flutter/constant/constant.dart';
import 'package:distribution_mall_flutter/http/modules/delete_account.dart';
import 'package:distribution_mall_flutter/provider/delete_account/delete_account_verify.dart';
import 'package:distribution_mall_flutter/router/router.gr.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

part 'delete_account_verify_service.g.dart';

class DeleteAccountVerifyService extends BaseService {
  bool isPhone;
  String accountName;

  DeleteAccountVerifyService(super.ref, this.isPhone, this.accountName);

  @override
  onReady() {
    ref
        .read(deleteAccountSendCodeProvider.notifier)
        .sendSmsCode(isPhone, accountName);
  }
}

@riverpod
DeleteAccountVerifyService deleteAccountVerifyService(
  DeleteAccountVerifyServiceRef ref,
  bool isPhone,
  String accountName,
) {
  return DeleteAccountVerifyService(ref, isPhone, accountName);
}
